package com.jwgf.smarowindingmachine_unity.ui;

import android.content.Context;
import android.os.Handler;
import android.view.LayoutInflater;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.jwgf.objectbox.CbfReport;
import com.jwgf.smarowindingmachine_unity.R;
import com.jwgf.smarowindingmachine_unity.logic.Report;

/**
 * Created by Jacky on 2017/8/18.
 */

public class ProductionDofferView extends LinearLayout {
    private TextView tv_succeeded_doffer_number;
    private TextView tv_dofferdoffing_total_number;
    private TextView tv_succeeded_doffer_ratio;
    private TextView tv_doffing_total_number;
    private TextView tv_succeeded_ratio;


    public ProductionDofferView(Context context) {
        super(context);
        LayoutInflater.from(context).inflate(R.layout.fragment_production_management_shift_report_doffer, this);
        tv_succeeded_doffer_number = (TextView) findViewById(R.id.succeeded_doffer_num_value);
        tv_dofferdoffing_total_number = (TextView) findViewById(R.id.dofferdoffing_total_num_value);
        tv_succeeded_doffer_ratio = (TextView) findViewById(R.id.succeeded_doffer_ratio_value);
        tv_doffing_total_number = (TextView) findViewById(R.id.doffing_total_num_value);
        tv_succeeded_ratio = (TextView) findViewById(R.id.succeeded_ratio_value);

    }

    public void setData(CbfReport shiftData) {
        tv_succeeded_doffer_number.setText(String.valueOf(shiftData.dofferDoffSucceedCount));
        tv_dofferdoffing_total_number.setText(String.valueOf(shiftData.dofferDoffCount));
        tv_succeeded_doffer_ratio.setText(String.valueOf(shiftData.dofferSucceedRatio));
        tv_doffing_total_number.setText(String.valueOf(shiftData.doffCount));
        tv_succeeded_ratio.setText(String.valueOf(shiftData.doffSucceedRatio));
    }
}
